﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Common;
using WebSite.Core;

namespace WebSite.Server
{
    /// <summary>
    /// GetRandomTrivia 的摘要说明
    /// </summary>
    public class GetRandomTrivia : IHttpHandler
    {

        public void ProcessRequest( HttpContext context )
        {
            context.Response.ContentType = "text/json";

            RetInfo response = RetInfoHelper.WebServiceReturn( delegate()
            {
                var tempTriviaBll = new Maticsoft.BLL.CarrefourCover.Trivia();
                return tempTriviaBll.GetRandomModelList( 9, " status=1" );
            } );

            context.Response.Write( response.SerializeToString( Common.Serialization.SerializationType.Json ) );
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}